/********************************************************************************/
/* Projekt  EBike_02                                                            */
/* Autor:   Gerhard Woelfl                                                      */
/* Datum:   29.05.2014                                                          */
/* Changes: 29.05.2014: Initial Version                                         */
/*                                                                              */
/********************************************************************************/

#include <xc.h>
#include <stdint.h>

#ifndef __ADC_CODE_H__
#define __ADC_CODE_H__

#define NUM_OF_AN       4

// adc channel assignment
#define V_PAS_AN_CHAN   6
#define V_DC_AN_CHAN    7
#define V_GAS_AN_CHAN   3
#define V_TEMP_AN_CHAN  8

// location of signal in buffers
#define V_PAS_BUF_IDX 0
#define V_DC_BUF_IDX 1
#define V_GAS_BUF_IDX 2
#define V_TEMP_BUF_IDX 3


// #define UBAT_AN_CHAN    6
// #define TORQUE_AN_CHAN  7
// #define GAS_AN_CHAN     8

#define V_PAS_OFS       0
#define V_DC_OFS        0
#define V_GAS_OFS       0
#define V_TEMP_OFS      0

#define I_DC_OFS        0
#define I_U_OFS         0
#define I_V_OFS         0

extern int16_t iu, iv, idc, vpas, vdc, vgas, vtemp;
extern int16_t iuFil, ivFil, idcFil, vpasFil, vdcFil, vgasFil, vtempFil;

// Function Prototypes **********************************************************
void ADCInit(void);
void getAdcOfs(void);
void getAdcVals(void);

#endif